import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../containers/Home'
import Bodybuild from '../containers/Bodybuilding'
import Find from '../containers/Find'
import Mine from '../containers/Mine'
import Movement from '../containers/HomeChild/Movement'
import Riding from '../containers/HomeChild/Riding'
import Run from '../containers/HomeChild/Run'
import Walking from '../containers/HomeChild/Walking'
import RunSet from '../containers/RunSet'
import RunRecord from '../containers/RunRecord'
import RunMap from '../containers/RunMap'
import Login from '../containers/Login'
import Register from '../containers/Register'
//健身
import Fodder from "../containers/Bodybuilds/Fodder"
import Trainer from "../containers/Bodybuilds/Trainer"
import Course from "../containers/Bodybuilds/Course"
import Train from "../containers/Bodybuilds/Train"
Vue.use(VueRouter)

export default new VueRouter({
  linkActiveClass:"active",
  routes: [
    {
      path: '/home',
      name: 'Home',
      component: Home,
      redirect:"/home/movement",//路由重定向  
      children:[
          {
            path:"movement",
            component:Movement
            // meta: {//缓存keepAlive
            //   keepAlive: false
            // }   
          },
          {
            path:"riding",
            component:Riding,
            name:Riding
          },
          {
            path:"run",
            component:Run,
            name:Run
          },
          {
            path:"walking",
            component:Walking,
            name:Walking
          },
      ]
    },
    {
      path: '/bodybuild',
      name: 'Bodybuild',
      component: Bodybuild,
      redirect:"/bodybuild/train",//路由重定向 
      children:[
        {
          path: 'train',
          name: 'Train',
          component: Train
        },
        {
          path: 'fodder',
          name: 'Fodder',
          component: Fodder
        },
        {
          path: 'course',
          name: 'Course',
          component: Course
        },
        {
          path: 'trainer',
          name: 'Trainer',
          component: Trainer
        }
      ]
    },
    {
      path: '/find',
      name: 'Find',
      component: Find
    },
    {
      path: '/mine',
      name: 'Mine',
      component: Mine
    },
    {
      path: '/runSet',
      name: 'RunSet',
      component: RunSet
    },
    {
      path: '/runRecord',
      name: 'RunRecord',
      component: RunRecord
    },
    {
      path: '/runMap',
      name: 'RunMap',
      component: RunMap
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/register',
      name: 'Register',
      component: Register
    }
  ]
})
